package com.lanou.renrenxin.base;

import android.app.Activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
import android.widget.Toast;

/**
 * Created by zy on 16/2/29.
 */
public class BaseActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        BaseApplication.addActivity(this);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        BaseApplication.removeActivity(this);
    }

    //吐司方法
    public static void ShowToast(String text){
        if (!TextUtils.isEmpty(text)) {
            Toast.makeText(BaseApplication.getContext(), text, Toast.LENGTH_SHORT).show();
        }
    }
}
